<?php

namespace App\Services;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 微信授权
 * @author ownfi
 */
interface IWeixinService {

    /**
     * 获取用户签名数据
     * @return mixed
     */
    public function getSignPackage();

    /**
     * 获取用户授权
     * @param type $redirect_uri
     * @return type
     */
    public function getUserAuthorize($redirect_uri, $successState);
    
    /**
     * 获取用户信息授权
     * @param type $redirect_uri
     * @return type
     */
    public function getUserinfoAuthorize($redirect_uri, $successState);

    /**
     * 根据code获取成员
     * @param type $code
     * @return type
     */
    public function getUser($code);
    
    /**
     * 根据auth_code获取成员信息
     * @param type $code
     * @return type
     */
    public function getUserinfo($auth_code);
    
    /**
     * userid转换成openid
     * @param type $userid
     * @return string
     */
    public function useridToOpenid($userid);
    
    /**
     * openid转换成userid
     * @param type $openid
     * @return string
     */
    public function openidToUserid($openid);

    /**
     * 获取媒体素材文件
     * localId以wxLocalResource://开头
     * serverId/mediaId是大小写字母数字密文
     * @param array $media_id
     * @return array
     */
    public function getMedia(array $media_ids);
}
